#include <stdio.h>

#define N 1000

int a[N], cnt;
int st[N];

void init()
{
    for (int i = 2; i < N; ++i)
    {
        if (!st[i])
        {
            a[cnt++] = i;
            for (int j = i + i; j < N; j += i)
                st[j] = 1;
        }
    }
}

int main()
{
    init();
    for (int i = 0; i < cnt; ++i)
        printf("%d ", a[i]);
    puts("");
    return 0;
}
